﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Service : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            LoadData();
        }
    }

    private void LoadData()
    {
        ManagementService process = new ManagementService();
        DataListServiceCategory.DataSource = process.GetService();
        DataBind();
    }
    protected void DataListServiceCategory_ItemCommand(object source, DataListCommandEventArgs e)
    {
        if (e.CommandName.Equals("Select"))
        {
            LinkButton lb = (LinkButton) DataListServiceCategory.Items[e.Item.ItemIndex].FindControl("LinkButton1");
            Response.Redirect("ServiceDetail.aspx?ServiceCategoryID=" + DataListServiceCategory.DataKeys[e.Item.ItemIndex]);
        }
    }
    protected void LinkButton2_Click(object sender, EventArgs e)
    {
        Response.Redirect("Service.aspx");
    }
}